package com.zh.rocketMq;

import com.zh.sys.service.EmployeeService;
import com.zhang.entity.Examine;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author: 96199
 * @className: EmailConsumer
 * @description:
 * @date: 2021/6/28 15:49
 * @version: 0.1
 * @since: jdk1.8
 */
@Component
@RocketMQMessageListener(consumerGroup = "ExamineConsumer",topic = "Nacos_Test")
public class EmailConsumer implements RocketMQListener<Examine> {
    @Resource
    private EmployeeService employeeService;

    @Override
    public void onMessage(Examine examine) {
        employeeService.sendEmail(examine);
    }
}
